{include file="public/tabs_head" /}

    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox">
                    <div class="ibox-title">
                        <h5>{$title}</h5>
                        <div class="ibox-tools">
                            <a href="#" class="btn btn-primary btn-xs cb_case_create">创建新项目</a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b-sm m-t-sm">
                            <div class="col-md-1">
                                <button type="button" id="loading-example-btn" class="btn btn-white btn-sm cb_refresh"><i class="fa fa-refresh"></i> 刷新</button>
                            </div>
                            <div class="col-md-11">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入项目名称" class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                            </div>
                        </div>

                        <div class="project-list">

                            <table class="table table-hover">
                                <tbody>
                                    <!-- 项目列表开始 -->
                                    {volist name="caselist" id="item"}
                                    <tr style="{if $item.star >0 }background-color:#FFEBCD;{/if}" class="tr_a" data-url="{:url('task/case_view',['id'=>$item.id])}"
                                        data-title="{$item.title}"
                                        >
                                        <td class="project-status" style="text-align:center;width:100px;"  >
{if $item.wait >0 }
<button type="button" class="btn btn-moc m-r-sm notp">{$item.wait}
{else}
<button type="button" class="btn btn-primary m-r-sm notp">{$item.over_num}/{$item.all_num}
{/if}
{if $item.notice >0 }
<div class="notice">{$item.notice}</div>
{/if}
</button>

                                        </span></td>
                                        <td class="project-title">
                                            <a href="{:url('task/case_view',['id'=>$item.id])}" class="tabs_a">[{$item.no}]-{$item.title}</a>
                                            <br>
                                            <small>{$item.create_user.username}创建于:{$item.create_time}  - {$item.update_user.username}最后更新于:{$item.update_time}</small>
                                        </td>
                                        <td class="project-completion">
                                                <small>当前进度： {$item.progress}%</small>
                                                <div class="progress progress-mini">
                                                    <div style="width: {$item.progress}%;" class="progress-bar"></div>
                                                </div>
                                        </td>
                                        <td class="project-people">
                                            {$item.team_info}
                                        </td>
                                        <td class="project-actions">
                                            <a href="#" class="btn btn-white btn-sm cb_case_edit" data-id="{$item.id}"><i class="fa fa-pencil"></i> 编辑 </a>
                                        </td>
                                    </tr>
                                    {/volist}
                                     <!-- 项目列表结束 -->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
<!--JS-->
<script>
$( ".cb_case_create" ).click(function() {
  //alert( "Handler for .click() called.{:url('task/case_create')}" );
    //iframe层-父子操作
    layer.open({
    type: 2,
    area: ['700px', '550px'],
    fix: false, //不固定
    title :'创建项目',
    maxmin: true,
        content: '{:url('task/case_create')}'
    });
});

$( ".cb_case_edit" ).click(function() {
    //iframe层-父子操作
    var id = $(this).data('id');
    //alert(id);
    layer.open({
    type: 2,
    area: ['700px', '550px'],
    fix: false, //不固定
    title :'修改项目',
    maxmin: true,
        content: '{:url('task/case_edit')}' + "&id=" + id
    });
    return false;
});

//刷新当前页
$( ".cb_refresh" ).click(function() {
    location.reload();
});
//A标签跳转
$( ".tabs_a" ).click(function() {
    var url = $(this).attr('href');
    var title = $.trim($(this).text());
    parent.tab_add(url,title);//在父类中打开
    return false;//停止A操作
});

//表格行跳转
$( ".tr_a" ).click(function() {
    var url  = $(this).data('url');
    var title = $(this).data('title');
    parent.tab_add(url,title);//在父类中打开
    return false;//停止A操作
});
//11分钟刷新一次
//var iID=setTimeout(function(){
 //   location.reload();// alert(iID);
//},120000);
</script> 
{include file="public/tabs_footer" /}